package com.gl.saasservice.sreach.controller;

import com.gl.framework.web.response.Result;
import com.gl.saasservice.sreach.service.AppKeywordSreachService;
import com.gl.saasservice.sreach.vo.AppKeywordSreachVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * APP搜索数据管理
 */

@Controller
@RequestMapping("/appKeywordSreach")
public class AppKeywordSreachController {

    @Autowired
    private AppKeywordSreachService appKeywordSreachService;

    /**
     * 列表
     */
    @GetMapping("/pages")
    @ResponseBody
    public Result pages(@RequestHeader String token,
                        @RequestParam(defaultValue = "0") Integer pageNumber,
                        @RequestParam(defaultValue = "10") Integer pageSize,
                        AppKeywordSreachVO vo){

        return appKeywordSreachService.pages(token, pageNumber, pageSize, vo);
    }

    /**
     * 添加
     */
    @PostMapping()
    @ResponseBody
    public Result add(@RequestHeader String token,
                      @RequestBody AppKeywordSreachVO vo){

        return appKeywordSreachService.save(token , vo);
    }

    /**
     * 修改
     */
    @PutMapping()
    @ResponseBody
    public Result update(@RequestHeader String token,
                      @RequestBody AppKeywordSreachVO vo){

        return appKeywordSreachService.save(token , vo);
    }

    /**
     * 删除
     */
    @DeleteMapping
    @ResponseBody
    public Result delete(@RequestHeader String token,@RequestParam Long id){

        return appKeywordSreachService.delete(token,id);
    }


}
